﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Security;
using System.Web.SessionState;
using System.Data.Entity;
using ShortUrl.WebUI.Models;
using ShortUrl.WebUI.Migrations;

namespace ShortUrl.WebUI
{
    public class Global : HttpApplication
    {
        void Application_Start(object sender, EventArgs e)
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<ShortUrlContext, Configuration>()); 

            // Code that runs on application startup
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            //Database.SetInitializer<ShortUrlContext>(new DropCreateDatabaseIfModelChanges<ShortUrlContext>());
        }
    }
}